home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / include / gnt / gntbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-04  |  2.4 KB  |  99 lines

  1. #ifndef GNT_BOX_H
  2. #define GNT_BOX_H
  3.  
  4. #include "gnt.h"
  5. #include "gntwidget.h"
  6.  
  7. #define GNT_TYPE_BOX                (gnt_box_get_gtype())
  8. #define GNT_BOX(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_BOX, GntBox))
  9. #define GNT_BOX_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_BOX, GntBoxClass))
  10. #define GNT_IS_BOX(obj)            (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_BOX))
  11. #define GNT_IS_BOX_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_BOX))
  12. #define GNT_BOX_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_BOX, GntBoxClass))
  13.  
  14. typedef struct _GntBox            GntBox;
  15. typedef struct _GntBoxClass        GntBoxClass;
  16.  
  17. typedef enum
  18. {
  19.     /* These for vertical boxes */
  20.     GNT_ALIGN_LEFT,
  21.     GNT_ALIGN_RIGHT,
  22.  
  23.     GNT_ALIGN_MID,
  24.  
  25.     /* These for horizontal boxes */
  26.     GNT_ALIGN_TOP,
  27.     GNT_ALIGN_BOTTOM
  28. } GntAlignment;
  29.  
  30. struct _GntBox
  31. {
  32.     GntWidget parent;
  33.  
  34.     gboolean vertical;
  35.     gboolean homogeneous;
  36.     gboolean fill;
  37.     GList *list;        /* List of widgets */
  38.  
  39.     GntWidget *active;
  40.     int pad;            /* Number of spaces to use between widgets */
  41.     GntAlignment alignment;  /* How are the widgets going to be aligned? */
  42.  
  43.     char *title;
  44.     GList *focus;        /* List of widgets to cycle focus (only valid for parent boxes) */
  45.  
  46.     void (*gnt_reserved1)(void);
  47.     void (*gnt_reserved2)(void);
  48.     void (*gnt_reserved3)(void);
  49.     void (*gnt_reserved4)(void);
  50. };
  51.  
  52. struct _GntBoxClass
  53. {
  54.     GntWidgetClass parent;
  55.  
  56.     void (*gnt_reserved1)(void);
  57.     void (*gnt_reserved2)(void);
  58.     void (*gnt_reserved3)(void);
  59.     void (*gnt_reserved4)(void);
  60. };
  61.  
  62. G_BEGIN_DECLS
  63.  
  64. GType gnt_box_get_gtype(void);
  65.  
  66. #define gnt_vbox_new(homo) gnt_box_new(homo, TRUE)
  67. #define gnt_hbox_new(homo) gnt_box_new(homo, FALSE)
  68.  
  69. GntWidget *gnt_box_new(gboolean homo, gboolean vert);
  70.  
  71. void gnt_box_add_widget(GntBox *box, GntWidget *widget);
  72.  
  73. void gnt_box_set_title(GntBox *box, const char *title);
  74.  
  75. void gnt_box_set_pad(GntBox *box, int pad);
  76.  
  77. void gnt_box_set_toplevel(GntBox *box, gboolean set);
  78.  
  79. void gnt_box_sync_children(GntBox *box);
  80.  
  81. void gnt_box_set_alignment(GntBox *box, GntAlignment alignment);
  82.  
  83. void gnt_box_remove(GntBox *box, GntWidget *widget); /* XXX: does NOT destroy widget */
  84.  
  85. void gnt_box_remove_all(GntBox *box);      /* Removes AND destroys all the widgets in it */
  86.  
  87. void gnt_box_readjust(GntBox *box);
  88.  
  89. void gnt_box_set_fill(GntBox *box, gboolean fill);
  90.  
  91. void gnt_box_move_focus(GntBox *box, int dir);  /* +1 to move forward, -1 for backward */
  92.  
  93. void gnt_box_give_focus_to_child(GntBox *box, GntWidget *widget);
  94.  
  95. G_END_DECLS
  96.  
  97. #endif /* GNT_BOX_H */
  98.  
  99.